package cn.cttic.base.api.domain.bo;

import cn.cttic.base.api.domain.BaseCompany;
import cn.cttic.common.mybatis.core.domain.BaseEntity;
import cn.cttic.common.core.validate.AddGroup;
import cn.cttic.common.core.validate.EditGroup;
import com.alibaba.excel.annotation.ExcelProperty;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
import org.hibernate.validator.constraints.Length;
import util.RegexpUtils;

import java.time.LocalDate;
import java.util.Date;

/**
 * 单位信息业务对象 base_company
 *
 * @author Times.Studio
 * @date 2024-09-17
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = BaseCompany.class, reverseConvertGenerate = false)
public class BaseCompanyBo extends BaseEntity {

    /**
     *
     */
    @NotBlank(message = "不能为空", groups = { EditGroup.class })
    private String id;

    /**
     * 上级单位标识
     */
    private String parentId;

    /**
     * 渠道类型
     */
    @NotBlank(message = "渠道类型不能为空", groups = { AddGroup.class, EditGroup.class })
    private String channelType;

    /**
     * 单位名称
     */
    @NotBlank(message = "单位名称不能为空", groups = { AddGroup.class, EditGroup.class })
    @Size(max = 50, message = "单位名称不能超过50字")
    private String companyName;

    /**
     * 单位简称
     */
    @Size(max = 20, message = "单位简称不能超过20字")
    private String shortName;

    /**
     * 单位类型
     */
     private String companyType;

    /**
     * 行业类型
     */
     private String industryType;

    /**
     * 社会信用代码
     */
    @NotBlank(message = "社会信用代码不能为空", groups = { AddGroup.class, EditGroup.class })
    private String creditCode;

    /**
     * 证照编号
     */
    private String licenseNumber;

    /**
     * 地区
     */
    private String district;

    /**
     * 法定代表人
     */
    @NotBlank(message = "法定代表人不能为空", groups = { AddGroup.class, EditGroup.class })
    @Size(max = 20, message = "法定代表人不能超过20字")
    private String legalPerson;

    /**
     * 注册资本
     */
    private Integer registerCapital;

    /**
     * 注册时间
     */
    @NotNull(message = "注册时间不能为空", groups = { AddGroup.class, EditGroup.class })
    private LocalDate establishDate;

    /**
     * 签发日期
     */
    private LocalDate signedDate;

    /**
     * 开始日期
     */
     private LocalDate startTerm;

    /**
     * 是否无限期
     */
    private Integer isLicenseIndefinite;

    /**
     * 结束日期
     */
     private LocalDate endTerm;

    /**
     * 登记机关
     */
    @Size(max = 20, message = "登记机关不能超过20字", groups = { AddGroup.class, EditGroup.class })
    private String registrationAuthority;

    /**
     * 注册地址
     */
    @NotBlank(message = "注册地址不能为空", groups = { AddGroup.class, EditGroup.class })
    @Size(max = 200, message = "注册地址不能超过200字", groups = { AddGroup.class, EditGroup.class })
    private String address;

    /**
     * 经营范围
     */
    @Size(max = 1000, message = "经营范围不能超过1000字", groups = { AddGroup.class, EditGroup.class })
    private String businessScope;

    /**
     * 主营业务
     */
    @Size(max = 500, message = "经营范围不能超过500字", groups = { AddGroup.class, EditGroup.class })
   private String businessExpertise;

    /**
     * 单位介绍
     */
    private String introduction;

    /**
     * 营业执照
     */
    private String businessLicense;

    /**
     * 单位logo
     */
    private String logo;

    /**
     * 认证状态
     */
    private Integer status;

    /**
     * 负责人姓名
     */
    @NotNull(message = "企业联系人不能为空", groups = { AddGroup.class, EditGroup.class })
    @Size(max = 20, message = "企业联系人不能超过20字", groups = { AddGroup.class, EditGroup.class })
    private String chargerName;

    /**
     * 负责人联系方式
     */
    @NotNull(message = "企业联系人手机号不能为空")
    @Pattern(regexp = RegexpUtils.MOBILE_PHONE_REGEXP, message = "请输入正确的手机号", groups = { AddGroup.class, EditGroup.class })
    private String chargerMobile;

    /**
     * 开户行
     */
    @Size(max = 50, message = "开户行不能超过50字", groups = { AddGroup.class, EditGroup.class })
    private String bankName;

    /**
     * 开户名
     */
    @Size(max = 50, message = "开户名不能超过50字", groups = { AddGroup.class, EditGroup.class })
    private String bankAccountName;

    /**
     * 开户账号
     */
    @Size(max = 20, message = "开户账号不能超过50字", groups = { AddGroup.class, EditGroup.class })
    @Pattern(regexp = "^\\+?[1-9][0-9]*$", message = "请输入正确的开户账号", groups = { AddGroup.class, EditGroup.class })
    private String bankAccount;

    /**
     * 企业电话
     */
    @Pattern(regexp = RegexpUtils.PHONE_REGEXP, message = "请输入正确的企业电话", groups = { AddGroup.class, EditGroup.class })
    private String companyTelephone;

    /**
     * 系统用户
     */
    private String sysUserId;

    /**
     * 移动用户
     */
    private String appUserId;


}
